/* 全局样式重置和基础设置 */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

/* 移除默认的body样式 */
body {
  display: block;
  place-items: unset;
  min-width: unset;
  min-height: unset;
}

/* 全局链接样式 */
a {
  font-weight: 500;
  color: #667eea;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #764ba2;
}

/* 全局按钮样式 */
button {
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  background-color: #667eea;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

button:hover {
  background-color: #764ba2;
  transform: translateY(-1px);
}

button:focus,
button:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* 应用容器样式 */
#app {
  width: 100%;
  height: 100vh;
  margin: 0;
  padding: 0;
  text-align: unset;
  overflow: hidden;
}

/* Element Plus 表格全局样式优化 */
.el-table {
  width: 100% !important;
  border-radius: 8px;
  overflow: hidden;
}

.el-table th {
  background-color: #f8f9fa !important;
  color: #333 !important;
  font-weight: 600 !important;
}

.el-table td {
  padding: 12px 0 !important;
}

.el-table--border {
  border: 1px solid #e9ecef !important;
}

.el-table--striped .el-table__body tr.el-table__row--striped td {
  background-color: #f8f9fa !important;
}

/* Element Plus 分页组件样式 */
.el-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 0;
}

.el-pagination .el-pager li {
  border-radius: 4px;
  margin: 0 2px;
}

.el-pagination .el-pager li.is-active {
  background-color: #667eea !important;
  color: white !important;
}

/* Element Plus 对话框样式优化 */
.el-dialog {
  border-radius: 12px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
}

.el-dialog__header {
  border-bottom: 1px solid #e9ecef;
  padding: 20px 24px !important;
}

.el-dialog__body {
  padding: 24px !important;
}

.el-dialog__footer {
  border-top: 1px solid #e9ecef;
  padding: 16px 24px !important;
}

/* Element Plus 表单样式优化 */
.el-form-item__label {
  font-weight: 500 !important;
  color: #333 !important;
}

.el-input__wrapper {
  border-radius: 6px !important;
}

.el-input__wrapper:hover {
  box-shadow: 0 0 0 1px #667eea inset !important;
}

.el-input__wrapper.is-focus {
  box-shadow: 0 0 0 1px #667eea inset !important;
}

/* Element Plus 按钮样式优化 */
.el-button {
  border-radius: 6px !important;
  font-weight: 500 !important;
  transition: all 0.3s ease !important;
}

.el-button:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
}

.el-button--primary {
  background-color: #667eea !important;
  border-color: #667eea !important;
}

.el-button--primary:hover {
  background-color: #764ba2 !important;
  border-color: #764ba2 !important;
}

.el-button--danger {
  background-color: #e74c3c !important;
  border-color: #e74c3c !important;
}

.el-button--danger:hover {
  background-color: #c0392b !important;
  border-color: #c0392b !important;
}

/* Element Plus 选择器样式优化 */
.el-select .el-input__wrapper {
  border-radius: 6px !important;
}

.el-select-dropdown {
  border-radius: 8px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
}

/* Element Plus 标签样式优化 */
.el-tag {
  border-radius: 4px !important;
  font-weight: 500 !important;
}

/* Element Plus 开关样式优化 */
.el-switch__core {
  border-radius: 12px !important;
}

.el-switch.is-checked .el-switch__core {
  background-color: #67c23a !important;
  border-color: #67c23a !important;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .el-table {
    font-size: 12px !important;
  }
  
  .el-dialog {
    width: 90% !important;
    margin: 5vh auto !important;
  }
  
  .el-form-item__label {
    font-size: 14px !important;
  }
  
  .el-button {
    font-size: 14px !important;
    padding: 8px 16px !important;
  }
}

@media (max-width: 480px) {
  .el-dialog {
    width: 95% !important;
    margin: 2vh auto !important;
  }
  
  .el-dialog__body {
    padding: 16px !important;
  }
  
  .el-form-item__label {
    font-size: 13px !important;
  }
  
  .el-button {
    font-size: 13px !important;
    padding: 6px 12px !important;
  }
}

/* 工具类 */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }

/* 动画类 */
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s ease;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

.slide-enter-active,
.slide-leave-active {
  transition: transform 0.3s ease;
}

.slide-enter-from {
  transform: translateX(-100%);
}

.slide-leave-to {
  transform: translateX(100%);
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  :root {
    color: #ffffff;
    background-color: #1a1a1a;
  }
  
  body {
    background-color: #1a1a1a;
    color: #ffffff;
  }
  
  .el-table {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
  }
  
  .el-table th {
    background-color: #3d3d3d !important;
    color: #ffffff !important;
  }
  
  .el-table td {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
  }
  
  .el-dialog {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
  }
}
